﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ViewFlaggedComments.aspx.cs" Inherits="AdminPages_ViewFlaggedComments" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" onrowcommand="GridView1_RowCommand" 
        DataKeyNames="MovieID">
        <Columns>
            <asp:BoundField DataField="CommentID" HeaderText="CommentID" 
                SortExpression="CommentID" />
            <asp:BoundField DataField="Comment" HeaderText="Comment" 
                SortExpression="Comment" />
            <asp:BoundField DataField="MovieID" HeaderText="MovieID" 
                SortExpression="MovieID" InsertVisible="False" ReadOnly="True" />
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:ButtonField ButtonType="Button" CommandName="deleteComment" 
                Text="delete Comment" />
            <asp:ButtonField ButtonType="Button" CommandName="unflagComment" 
                Text="unflag Comment" />
            <asp:ButtonField ButtonType="Button" CommandName="ViewCommentContext" 
                Text="view comment in context" />
        </Columns>
        <EmptyDataTemplate>
            No data available
        </EmptyDataTemplate>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        
        SelectCommand="SELECT FlaggedComment.CommentID, Comment.Comment, Movie.MovieID, Movie.Title FROM FlaggedComment INNER JOIN Comment ON FlaggedComment.CommentID = Comment.CommentID INNER JOIN Movie ON Comment.MovieID = Movie.MovieID">
    </asp:SqlDataSource>
</asp:Content>

